package main

import (
	"fmt"
	"time"

	"github.com/tarm/serial"
)

func main() {
	config := &serial.Config{
		Name:        "COM13",
		Baud:        115200,
		ReadTimeout: 100 * time.Second,
	}
	s, err := serial.OpenPort(config)
	if err != nil {
		panic(err)
	}
	var buf [100]byte
	n, err := s.Read(buf[0:])
	if err != nil {
		panic(err)
	}
	fmt.Printf("%d: %s\n", n, string(buf[0:n]))
}
